package cn.myj2c.executor.providers;

import cn.myj2c.executor.values.JavaValue;
import cn.myj2c.executor.Context;

import java.util.List;

public abstract class ComparisonProvider implements Provider {
    @Override
    public boolean canInvokeMethod(String className, String methodName, String methodDesc, JavaValue targetObject, List<JavaValue> args, Context context) {
        return false;
    }

    @Override
    public boolean canGetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context) {
        return false;
    }

    @Override
    public boolean canSetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context) {
        return false;
    }

    @Override
    public Object invokeMethod(String className, String methodName, String methodDesc, JavaValue targetObject, List<JavaValue> args, Context context) {
        throw new IllegalStateException("Cannot invoke method on ComparisonProvider");
    }

    @Override
    public void setField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context) {
        throw new IllegalStateException("Cannot set field on ComparisonProvider");
    }

    @Override
    public Object getField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context) {
        throw new IllegalStateException("Cannot get field on ComparisonProvider");
    }
}
